/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package aviso.facade;

import aviso.entity.AreaType;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

/**
 *
 * @author avgusti
 */
@Stateless
public class AreaTypeFacade extends AbstractFacade<AreaType> {
    @PersistenceContext(unitName = "aviso")
    private EntityManager em;

    protected EntityManager getEntityManager() {
        return em;
    }

    public AreaTypeFacade() {
        super(AreaType.class);
    }
    
    public AreaType getByName(String name)
    {
        return em.createQuery("select t from AreaType t where t.name=:name", AreaType.class).setParameter("name",name).getSingleResult();
    }
}
